package com.yc.test;

import com.yc.dao.DBHelper;

import java.lang.reflect.InvocationTargetException;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class test1 {
    public static void main(String[] args) throws InvocationTargetException, InstantiationException, IllegalAccessException, SQLException {
        DBHelper db = new DBHelper();
        String sql = "SELECT MAX(sid) AS sid FROM shoes";
       List<Map<String, Object>> ll= db.select(sql);
        int msid;
        String data= ll.toString();

// 使用正则表达式提取数字部分
        Pattern pattern = Pattern.compile("\\d+"); // 匹配数字
        Matcher matcher = pattern.matcher(data);

        if (matcher.find()) {
            String numberStr = matcher.group(); // 提取到的数字字符串
            msid = Integer.parseInt(numberStr); // 将字符串转换为整数
            int sid=msid+1;

        }
    }



}